<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="./css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/styleold.css" />
    <link rel="stylesheet" type="text/css" href="./css/style.css" />
    <link rel="stylesheet" type="text/css" href="./css/percircle.css" />
    <script type="text/javascript" src="./script/base.js"></script>
    <script type="text/javascript" src="./script/api.js"></script>
    <script type="text/javascript" src="./script/jquery.min.js"></script>
</head>

<body>
    <header class="aui-bar aui-bar-nav">
        <a class="aui-pull-left" tapmode onclick="closeWin()">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title">找回交易密码</div>
    </header>
    <div class="aui-bar-nav-d"></div>

    <ul class="user-password">
        <li>
            <label>姓名</label>
            <input class="text-1" type="text" placeholder="请输入您的姓名" id="name">
            <div class="check" id="checkOldPSW"></div>
        </li>
        <li>
            <label>身份证号</label>
            <input class="text-1" type="number" placeholder="请输入您的身份证号码" id="idno">
            <div class="check" id="checkPSW"></div>
        </li>
    </ul>

    <div class="user-data-btn" tapmode onclick="fixPwd();">下一步</div>

</body>
<script type="text/javascript">
    function user_mobile_verification() {
        var delay = 0;
        if (api.systemType != 'ios') {
            // delay = 300;
        }
        api.openWin({
            name: 'user_mobile_verification',
            url: './user_mobile_verification.html',
            bounces: false,
            delay: delay,
            slidBackEnabled: true,
            vScrollBarEnabled: false,
            progress: {
                type: "page"
            }
        });
    };

    function closeWin() {
        api.closeWin({});
    }

    // 确认修改
    function fixPwd() {


        var name = $("#name").val();
        var idno = $("#idno").val();

        if (!name) {
            $api.byId('checkOldPSW').innerText = '姓名不能为空';
            return false;
        } else {
            $api.byId('checkOldPSW').innerText = '';
        }

        if (!idno) {
            $api.byId('checkPSW').innerText = '身份证号不能为空';
            return false;
        } else {
            $api.byId('checkPSW').innerText = '';
        }

        var true_name = $api.getStorage('user_name_true');
        var true_idno = $api.getStorage('idno');
        if (name == true_name && idno == true_idno) {
            api.openWin({
                name: 'forget_mobile_verification',
                url: './forget_mobile_verification.html',
            });
        } else {
            alert('姓名或身份证号错误!');
        }
    }
</script>

</html>
